<?php
namespace app\admin\validate;

use think\Validate;

class GoodsGroupValidate extends Validate
{
    protected $rule =   [
        'id '                   => 'require|number',
        'page|页数'             => 'require|number',
        'limit|条数'            => 'require|number',
        'admin_id|店铺'         => 'require|number',
        'goods_id|商品'         => 'require|number',
        'price_only|单买价格'   => 'require|gt:0',
        'price_sec|二人团价格'  => 'require|gt:0',
        'price_thi|三人团价格'  => 'require|gt:0',
        'price_original|划线价' => 'require|gt:0',
        'group_time|销售时间'   => 'require|number',
        'wait_time|拼团时间'    => 'require|number',
    ];
    
    protected $scene = [
        'show'     => ['id'],
        'list'     => ['page', 'limit'],
        'add'      => ['admin_id', 'goods_id', 'price_only', 'price_sec', 'price_thi', 'price_original', 'group_time', 'wait_time'],
        'edit'     => ['id', 'price_only', 'price_sec', 'price_thi', 'price_original', 'group_time', 'wait_time'],
    ];
}